home *** CD-ROM | disk | FTP | other *** search
- =============================================================================
- f2c_go32.dif (for f2c Version 19950201)
-
- Brief Note
- ----------
- By applying this patch to a complete set of f2c source files available from
- ftp://netlib.att.com/netlib/f2c/, you can build f2c that works with djgpp.
- You need ~/* and ~/src/* in this directory. You also have to uncompress all
- the files, and unarchive the shell-archived library sources, i.e., libf77
- and libi77. Then, follow the instruction described below:
-
- 1) Go to the top directory of your f2c source directory tree.
- 2) patch -p1 < f2c_go32.dif.
- 3) Run mk.bat (it is safe to remove any *old* f2c.h in your djgpp's
- include paths before running mk.bat).
- 4) You'll get ./src/f2c.exe and ./libf2c.a.
- 5) Install f2c.exe, f2c.h and libf2c.a like this:
- C>install c:\djgpp (should be your djgpp top directory).
- You may manually copy them instead.
-
- You need "grep", "sed", "cat" and "rm" running under DOS for successful
- compilation. GNUish stuffs (available from SimTel) work fine. djgpp version
- of "sed" does as well.
-
- This patch was organized by R. Araki in cooperation with H. Kuroki, thanks
- to suggestions by net people both at FEXT, niftyserve.or.jp and djgpp-ML. You
- can easily identify the changes by searching a string "K&R (Kuroki & Raraki)".
-
- This file is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY. Any suggestions/ideas will be appreciated. You must obey the
- description written in "permission" available from netlib.att.com:/netlib/f2c/
- if you redistribute this file.
-
- Important Notice
- ----------------
- libF77.a and libI77.a are combined into a single library named libf2c.a in
- accordance with description in netlib.att.com:/netlib/f2c/readme. You
- *must* specify "-lf2c -lm" instead of "-lF77 -lI77 -lm" with ld or gcc. You
- may want to modify f2c.1 and/or f2c.1t, since I kept them unmodified.
-
- The following macro defined in f2c.h may conflict with function prototype
- declaration of abs() in djgppstd.h (i.e., int abs(int);).
-
- > #define abs(x) ((x) >= 0 ? (x) : -(x))
-
- I didn't comment it out because David M. Gay (dmg@research.att.com), a
- member of the f2c development team at AT&T Bell Labs, recommended me to
- leave it unmodified. Consider applying the following patch to djgppstd.h:
-
- > *** djgppstd.org Tue Nov 29 02:10:22 1994
- > --- djgppstd.h Tue Jan 24 13:02:26 1995
- > ***************
- > *** 58,60 ****
- > --- 58,62 ----
- > void abort(void);
- > + #ifndef F2C_INCLUDE
- > int abs(int);
- > + #endif
- > int access(const char*, int);
-
-
- Enjoy!!
- February 6, 1995 Ryuichiro ARAKI
- raraki@human.waseda.ac.jp
- MCN00365@niftyserve.or.jp
- =============================================================================
- diff --context=1 --recursive --new-file f2c_orig/install.bat f2c_go32/install.bat
- *** f2c_orig/install.bat Wed Dec 31 19:00:00 1969
- --- f2c_go32/install.bat Mon Feb 6 11:32:32 1995
- ***************
- *** 0 ****
- --- 1,35 ----
- + @echo off
- + REM a batch file to install f2c.exe, f2c.h and libf2c.a
- + REM 12/18/94 by raraki
- + if M%1 == M goto usage
- +
- + if not exist .\src\f2c.exe goto makeexe
- + echo copying f2c.exe to %1\bin
- + copy .\src\f2c.exe %1\bin
- +
- + if not exist .\f2c.h goto chkf2ch
- + echo copying f2c.h to %1\include
- + copy .\f2c.h %1\include
- +
- + if not exist .\libf2c.a goto makelibf2c
- + echo copying libf2c.a to %1\lib
- + copy .\libf2c.a %1\lib
- + goto end
- +
- + :usage
- + echo usage:- install [your djgpp's top directory (e.g., c:\djgpp)]
- + goto end
- +
- + :makeexe
- + echo .\src\f2c.exe not found. You have to make it first.
- + goto end
- +
- + :chkf2ch
- + echo .\f2c.h not found. You have to check it.
- + goto end
- +
- + :makelibf2c
- + echo .\libf2c.a not found. You have to make it first.
- + goto end
- +
- + :end
- diff --context=1 --recursive --new-file f2c_orig/libf77/makefile f2c_go32/libf77/makefile
- *** f2c_orig/libf77/makefile Sat Feb 4 20:22:02 1995
- --- f2c_go32/libf77/makefile Mon Feb 6 11:32:36 1995
- ***************
- *** 1,5 ****
- .SUFFIXES: .c .o
- ! CC = cc
- ! SHELL = /bin/sh
- ! CFLAGS = -O
-
- --- 1,10 ----
- .SUFFIXES: .c .o
- ! # 12/15/94 by K&R (Kuroki & Raraki)
- ! CC = gcc
- ! #SHELL = /bin/sh
- ! # Some files may need to include ../f2c.h.
- ! # You may check whether djgpp's onexit() works or not. If it works
- ! # fine, you may omit "-DNO_ONEXIT".
- ! # 12/17/94 by K&R (Kuroki & Raraki)
- ! CFLAGS = -O2 -m486 -I.. -DNO_ONEXIT
-
- ***************
- *** 17,20 ****
- $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c
- ! ld -r -x -o $*.xxx $*.o
- ! mv $*.xxx $*.o
-
- --- 22,28 ----
- $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c
- ! # Some people reported that in some cases "ld -r -x" doesn't work well
- ! # with djgpp. The drawback is larger object files. Uncomment the following
- ! # lines if you are sure it works fine. 12/17/94 by K&R (Kuroki & Raraki)
- ! # ld -r -x -o $*.xxx $*.o
- ! # mv $*.xxx $*.o
-
- ***************
- *** 41,46 ****
-
- ! libF77.a : $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \
- $(HALF) $(CMP) $(EFL) $(CHAR)
- ! ar r libF77.a $?
- ! ranlib libF77.a
-
- --- 49,57 ----
-
- ! libf77/*.o : $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \
- $(HALF) $(CMP) $(EFL) $(CHAR)
- ! # You don't have to build libF77.a, since libf2c.a will include *.o here.
- ! # If you really need to have it, uncomment the following lines.
- ! # 12/18/94 by K&R (Kuroki & Raraki)
- ! # ar r libF77.a $?
- ! # ranlib libF77.a
-
- ***************
- *** 57,59 ****
- clean:
- ! rm -f libF77.a *.o
-
- --- 68,72 ----
- clean:
- ! # 12/21/94 by K&R (Kuroki & Raraki)
- ! # rm -f libF77.a *.o
- ! rm -f *.o
-
- diff --context=1 --recursive --new-file f2c_orig/libf77/s_paus.c f2c_go32/libf77/s_paus.c
- *** f2c_orig/libf77/s_paus.c Sat Feb 4 20:22:02 1995
- --- f2c_go32/libf77/s_paus.c Mon Feb 6 11:32:36 1995
- ***************
- *** 18,21 ****
- --- 18,30 ----
- #endif
- + /* to avoid conflict with djgppstd.h.
- + * 12/15/94 by K&R (Kuroki & Raraki)
- + */
- + #ifndef __GO32__
- extern int getpid(void), isatty(int), pause(void);
- + #else /* __GO32__ */
- + extern int getpid(void), isatty(int);
- + extern void volatile pause(void);
- + #endif /* __GO32__ */
- #endif
- + /* end of Patch */
-
- diff --context=1 --recursive --new-file f2c_orig/libi77/fio.h f2c_go32/libi77/fio.h
- *** f2c_orig/libi77/fio.h Sat Feb 4 20:22:02 1995
- --- f2c_go32/libi77/fio.h Mon Feb 6 11:32:38 1995
- ***************
- *** 1 ****
- --- 1,7 ----
- + /* to avoid conflict with djgppstd.h.
- + * 12/18/94 by K&R (Kuroki & Raraki)
- + */
- + #if defined(abs) && defined(__GO32__)
- + #undef abs
- + #endif
- #include "stdio.h"
- diff --context=1 --recursive --new-file f2c_orig/libi77/makefile f2c_go32/libi77/makefile
- *** f2c_orig/libi77/makefile Sat Feb 4 20:22:02 1995
- --- f2c_go32/libi77/makefile Mon Feb 6 11:32:40 1995
- ***************
- *** 1,5 ****
- .SUFFIXES: .c .o
- ! CC = cc
- ! CFLAGS = -O
- ! SHELL = /bin/sh
-
- --- 1,8 ----
- .SUFFIXES: .c .o
- ! # 12/15/94 by K&R (Kuroki & Raraki)
- ! CC = gcc
- ! # Some files may need to include ../f2c.h.
- ! # 12/15/94 by K&R (Kuroki & Raraki)
- ! CFLAGS = -O2 -m486 -I..
- ! #SHELL = /bin/sh
-
- ***************
- *** 8,11 ****
- $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c
- ! ld -r -x -o $*.xxx $*.o
- ! mv $*.xxx $*.o
-
- --- 11,17 ----
- $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c
- ! # Some people reported that in some cases "ld -r -x" doesn't work well
- ! # with djgpp. The drawback is larger object files. Uncomment the following
- ! # lines if you are sure it works fine. 12/17/94 by K&R (Kuroki & Raraki)
- ! # ld -r -x -o $*.xxx $*.o
- ! # mv $*.xxx $*.o
-
- ***************
- *** 15,19 ****
- util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o
- ! libI77.a: $(OBJ)
- ! ar r libI77.a $?
- ! ranlib libI77.a
- install: libI77.a
- --- 21,28 ----
- util.o wref.o wrtfmt.o wsfe.o wsle.o wsne.o xwsne.o
- ! libi77/*.o: $(OBJ)
- ! # You don't have to build libI77.a, since libf2c.a will include *.o here.
- ! # If you really need to have it, uncomment the following lines.
- ! # 12/18/94 by K&R (Kuroki & Raraki)
- ! # ar r libI77.a $?
- ! # ranlib libI77.a
- install: libI77.a
- ***************
- *** 31,34 ****
- clean:
- ! rm -f $(OBJ) libI77.a
- !
- clobber: clean
- --- 40,44 ----
- clean:
- ! # 12/21/94 by K&R (Kuroki & Raraki)
- ! # rm -f $(OBJ) libI77.a
- ! rm -f *.o
- clobber: clean
- diff --context=1 --recursive --new-file f2c_orig/libi77/rawio.h f2c_go32/libi77/rawio.h
- *** f2c_orig/libi77/rawio.h Sat Feb 4 20:22:02 1995
- --- f2c_go32/libi77/rawio.h Mon Feb 6 11:32:42 1995
- ***************
- *** 3,5 ****
- #else
- ! #ifdef MSDOS
- #include "io.h"
- --- 3,8 ----
- #else
- ! /*
- ! * 12/15/94 by K&R (Kuroki & Raraki)
- ! */
- ! #if defined(MSDOS) && !defined(__GO32__)
- #include "io.h"
- diff --context=1 --recursive --new-file f2c_orig/mk.bat f2c_go32/mk.bat
- *** f2c_orig/mk.bat Wed Dec 31 19:00:00 1969
- --- f2c_go32/mk.bat Mon Feb 6 11:32:44 1995
- ***************
- *** 0 ****
- --- 1,41 ----
- + @echo off
- + REM a batch file to build all.
- + REM 12/17/94 by raraki
- + cd .\src
- + make
- + if errorlevel 1 goto src_err
- +
- + cd ..\libf77
- + make
- + if errorlevel 1 goto libf77_err
- +
- + cd ..\libi77
- + make
- + if errorlevel 1 goto libi77_err
- +
- + cd ..
- + ar rvs libf2c.a libf77/*.o libi77/*.o
- + if errorlevel 1 goto libf2c_err
- + echo finished.
- + goto end
- +
- + :src_err
- + cd ..
- + echo An error occurred while making f2c.exe
- + goto end
- +
- + :libf77_err
- + cd ..
- + echo An error occurred while making libf77/*.o
- + goto end
- +
- + :libi77_err
- + cd ..
- + echo An error occurred while making libi77/*.o
- + goto end
- +
- + :libf2c_err
- + echo An error occurred while making libf2c.a
- + goto end
- +
- + :end
- diff --context=1 --recursive --new-file f2c_orig/src/makefile f2c_go32/src/makefile
- *** f2c_orig/src/makefile Sat Feb 4 20:22:02 1995
- --- f2c_go32/src/makefile Mon Feb 6 11:32:46 1995
- ***************
- *** 2,6 ****
-
- ! g = -g
- ! CFLAGS = $g
- ! SHELL = /bin/sh
-
- --- 2,11 ----
-
- ! # 12/15/94 by K&R (Kuroki & Raraki)
- ! CC=gcc
- ! CFLAGS = -O2 -m486
- ! #SHELL = /bin/sh
- !
- ! # 12/15/94 by K&R (Kuroki & Raraki)
- ! YACC = bison
- ! YFLAGS = -v
-
- ***************
- *** 10,25 ****
- parse_args.o niceprintf.o cds.o sysdep.o version.o
- ! OBJECTS = $(OBJECTSd) malloc.o
-
- ! all: xsum.out f2c
- !
- ! f2c: $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o f2c
-
- gram.c: gram.head gram.dcl gram.expr gram.exec gram.io defs.h tokdefs.h
- ! ( sed <tokdefs.h "s/#define/%token/" ;\
- ! cat gram.head gram.dcl gram.expr gram.exec gram.io ) >gram.in
- ! $(YACC) $(YFLAGS) gram.in
- echo "(expect 4 shift/reduce)"
- ! sed 's/^# line.*/\/* & *\//' y.tab.c >gram.c
- ! rm -f gram.in y.tab.c
-
- --- 15,45 ----
- parse_args.o niceprintf.o cds.o sysdep.o version.o
- ! # 12/15/94 by K&R (Kuroki & Raraki)
- ! OBJECTS = $(OBJECTSd) #malloc.o
-
- ! # 12/15/94 by K&R (Kuroki & Raraki)
- ! #all: xsum.out f2c
- ! all: f2c.exe
- !
- ! # 12/15/94 by K&R (Kuroki & Raraki)
- ! #f2c: $(OBJECTS)
- ! # $(CC) $(LDFLAGS) $(OBJECTS) -o f2c
- ! f2c.exe: $(OBJECTS)
- $(CC) $(LDFLAGS) $(OBJECTS) -o f2c
- + strip f2c
- + coff2exe f2c
-
- + # 12/15/94 by K&R (Kuroki & Raraki)
- gram.c: gram.head gram.dcl gram.expr gram.exec gram.io defs.h tokdefs.h
- ! # ( sed <tokdefs.h "s/#define/%token/" ;\
- ! # cat gram.head gram.dcl gram.expr gram.exec gram.io ) >gram.in
- ! # $(YACC) $(YFLAGS) gram.in
- ! sed <tokdefs.h "s/#define/%%token/" > gram
- ! cat gram.head gram.dcl gram.expr gram.exec gram.io >>gram
- ! $(YACC) $(YFLAGS) gram
- echo "(expect 4 shift/reduce)"
- ! # 12/15/94 by K&R (Kuroki & Raraki)
- ! # sed 's/^# line.*/\/* & *\//' y.tab.c >gram.c
- ! # rm -f gram.in y.tab.c
- ! sed 's/^# line.*/\/* & *\//' gram_tab.c >gram.c
- ! rm -f gram gram_tab.c
-
- ***************
- *** 87,90 ****
- #carriage-return characters.
- xsumr.out: xsum $b
- ! ./xsum -r $b >xsum1.out
- ! cmp xsum0.out xsum1.out && mv xsum1.out xsumr.out
- --- 107,115 ----
- #carriage-return characters.
- + # 12/17/94 by K&R (Kuroki & Raraki), thanks to K. Masaki's suggestion.
- xsumr.out: xsum $b
- ! echo.exe -o xsum.rf $b
- ! go32 xsum -r @xsum.rf >xsum1.out
- ! echo cmp xsum0.out xsum1.out >ifdiff.bat
- ! echo if errorlevel 1 copy xsum1.out xsumr.out >>ifdiff.bat
- ! ifdiff.bat
- ! rm ifdiff.bat xsum.rf
-